<template>
  <div class='articleItem-container van-hairline--bottom'>
    <!-- <van-cell :to="'article/' + article.art_id"> -->
    <!-- ES6写法 -->
    <van-cell :to="`article/${article.art_id}`">
      <div slot="title" class="title van-multi-ellipsis--l2">{{article.title}}</div>
      <div slot="default" v-if="article.cover.type == 1" class="right-wrap">
        <van-image fit="cover"
          :src="article.cover.images[0]" />
      </div>
      <div slot="label" v-if="article.cover.type == 3" class="cover-wrap">
        <van-image fit="cover"
          :src="img" v-for="(img, index) in article.cover.images" :key="index"/>
      </div>
      <div slot="label" class="bottom-wrap">
        <span>{{article.aut_name}}</span>
        <span>{{article.comm_count}}评论</span>
        <span>{{article.pubdate | relativeTime}}</span>
      </div>
    </van-cell>
  </div>
</template>
<script>
export default {
  name: 'articleItemPage',
  components: {},
  props: {
    article: {
      type: Object,
      require: true,
    },
  },
  data() {
    return {};
  },
  created() {},
  computed: {},
  methods: {},
};
</script>
<style lang='less' scoped>
.articleItem-container {
  .title {
    font-size: 32px;
    color: #3a3a3a;
  }
  .van-cell__value {
    flex: unset;
    -webkit-flex: unset;
    -webkit-box-flex: unset;
    width: 232px;
	  height: 146px;
    padding-left: 25px;
  }
  .van-cell__title {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  .cover-wrap {
    height: 146px;
    display: flex;
    .van-image {
      width: 226px;
      height: 100%;
      &:not(:last-child) {
        margin-right: 4px;
      }
    }
  }
  .bottom-wrap {
    font-size: 23px;
    color: #b4b4b4;
    span {
      margin-right: 20px;
    }
  }
}
</style>
